import axios from "axios"
axios.defaults.timeout = 10000;
axios.defaults.baseURL = "http://localhost:3005/api/"

export const get = async (url: string, params?: any) => {
    try {
        const res = await axios.get(url, { params });
        return res.data;
    } catch (error) {
        console.log(error);
    }
}
export const post = async (url: string, data: any, headers: any, params: any) => {
    try {
        const res = await axios.post(url, data, { headers, params });
        return res.data;
    } catch (error) {
        console.log(error);
    }
}